Skip to content

Fix add plugin unit test #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2015
Merged

Fix add plugin unit test #780

merged 1 commit into from
Aug 13, 2015

Conversation

teobugslayer
Copy link
Contributor

Npm has a global configuration to save dependencies with exact versions or as ^ ones. This unit test must work in both configurations. Therefore, we check for one of the two possible outcomes.

Also, small code cleanups.

@teobugslayer teobugslayer added this to the 1.3.0 milestone Aug 13, 2015
@ns-bot
Copy link

ns-bot commented Aug 13, 2015

assert.deepEqual(actualDependencies, expectedDependencies);
let expectedDependencies = { "plugin1": "^1.0.3" };
let expectedDependenciesExact = { "plugin1": "1.0.3" };
assert.isTrue(_.isEqual(actualDependencies, expectedDependencies) || _.isEqual(actualDependencies, expectedDependenciesExact));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use deepEqual here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_.isEqual compares deeply

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we consider both syntax are correct (^1.0.3 and 1.0.3) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have updated PR description.

@Fatme
Copy link
Contributor

Fatme commented Aug 13, 2015

👍 after rebasing on master

@teobugslayer teobugslayer force-pushed the totev/fix-plugin-check-ver branch from 09c560b to b14d4b7 Compare August 13, 2015 08:54
@ns-bot
Copy link

ns-bot commented Aug 13, 2015


let commandsService = testInjector.resolve(CommandsServiceLib.CommandsService);
commandsService.tryExecuteCommand("plugin|add", [pluginName+"@1.0.0"]).wait();
pluginsService.add(pluginName+"@1.0.0").wait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe ${pluginName}@1.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed to leave the code as is.

Small code cleanups
@teobugslayer teobugslayer force-pushed the totev/fix-plugin-check-ver branch from b14d4b7 to 07bf8d9 Compare August 13, 2015 10:26
@ns-bot
Copy link

ns-bot commented Aug 13, 2015

@rosen-vladimirov
Copy link
Contributor

👍

teobugslayer added a commit that referenced this pull request Aug 13, 2015
@teobugslayer teobugslayer merged commit 2d2ff89 into master Aug 13, 2015
@teobugslayer teobugslayer deleted the totev/fix-plugin-check-ver branch August 13, 2015 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants